import Vue from 'vue'
import App from './App.vue'
import router from '@/router'
import TypeNav from '@/components/TypeNav'
import store from '@/store'
import '@/mock/mockServe'
import Pagination from '@/components/Pagination'
import "swiper/css/swiper.css";
import ElementUI from 'element-ui'
import 'element-ui/lib/theme-chalk/index.css'
import * as API from '@/api';
import { Button, MessageBox } from 'element-ui';

Vue.use(ElementUI);

Vue.config.productionTip = false
//Vue.component注册全局组件，第一个参数是使用的时候叫什么组件名字，第二个是实际使用的组件
Vue.component(TypeNav.name, TypeNav)
Vue.component(Pagination.name, Pagination)
Vue.component(Button.name, Button);
//ElementUI注册组件的时候，还有一种写法，挂在原型上
Vue.prototype.$msgbox = MessageBox;
Vue.prototype.$alert = MessageBox.alert;

new Vue({
  render: h => h(App),
  beforeCreate() {
    Vue.prototype.$bus = this;
    Vue.prototype.$API = API;
  },
  store,
  router,
}).$mount('#app')

